{extend name="layout/base" /}
<!-- 标题 -->
{block name="title"}{$site['site_name']} - 参数管理{/block}
<!-- CSS -->
{block name="css"}{/block}
<!-- 具体内容 -->
{block name="content"}
<h2 class="header-dividing"> 
    {$site['site_name']}
    <small class="text-danger"><b>{:isset($column['column_name'])?$column['column_name']:''}</b></small>
    <small>参数管理</small>
</h2>
<div class="navbar navbar-default navbar-content">
    <div class="collapse navbar-collapse">
        <ul class="nav navbar-nav">
            <li><a data-toggle="modal" data-target="#modal-create" data-action="{:url('@admin/site/param_save')}"> <i class="icon icon-plus"></i> 添加参数</a></li>
            <li><a href="{:url('@admin/site/column', 'siteid='.$site['site_id'])}"> <i class="icon icon-th-list"></i> 栏目管理</a></li>
            <li><a href="{:url('@admin/site')}"> <i class="icon icon-sitemap"></i> 站点管理</a></li>
        </ul>
        <!-- 导航中的表单 -->
        <form class="navbar-form navbar-left" role="search" method="get" action="{:url('@admin/site/param')}">
            <input type="hidden" name="site_id" value="{$site['site_id']}">
            <input type="hidden" name="column_id" value="{:isset($column['column_id'])?$column['column_id']:'0'}">
            <input type="text" class="form-control" placeholder="搜索" name="keywords" value="{$keywords}">
            <button type="submit" class="btn btn-default">搜索</button>
        </form>
    </div>
</div>
<div class="panel">
    <table class="table datatable table-fixed" data-checkable="true" data-check-by-click-row="false" data-fixed-left-width="240" data-fixed-right-width="260">
        <thead>
            <tr>
                <th data-width="50" class="text-center">ID</th>
                <th data-width="150">参数名称</th>
                <th data-width="100" class="flex-col">类型</th>
                <th data-width="80" class="flex-col text-center">必填</th>
                <th class="flex-col">初始值</th>
                <th class="flex-col">提示</th>
                <th data-width="100" class="text-center">排序</th>
                <th data-width="80" class="text-center">修改</th>
                <th data-width="80" class="text-center">删除</th>
            </tr>
        </thead>
        <tbody>
            {volist name="list" id="vo"}
            <tr data-id="{$vo['param_id']}">
                <td class="text-center">{$vo['param_id']}</td>
                <td>{$vo['param_name']}</td>
                <td>{$vo['param_type_html']|raw}</td>
                <td class="text-center">{$vo['param_required_html']|raw}</td>
                <td>{$vo['param_value']}</td>
                <td>{$vo['param_tips']}</td>
                <td><input type="text" class="form-control text-center sort" data-url="{:url('@admin/site/param_sort')}" data-old-sort="{$vo['param_sort']}" data-id="{$vo['param_id']}" value="{$vo['param_sort']}"></td>
                <td class="text-center"><a data-toggle="modal" data-target="#modal-create" data-url="{:url('@admin/site/param_edit', 'id='.$vo['param_id'])}" data-action="{:url('@admin/site/param_update')}">修改</a></td>
                <td class="text-center"><a class="delete" data-url="{:url('@admin/site/param_delete','id='.$vo['param_id'])}">删除</a></td>
            </tr>
            {/volist}
        </tbody>
    </table>
    {empty name="list"}
    <div class="mb20 mt20 text-center">
        {if ($keywords!='')}
            未搜索到 “{$keywords}” 相关的参数 &nbsp; <a href="{:url('@admin/site/param', 'siteid='.$site['site_id']).'&columnid='.(isset($column['column_id'])?$column['column_id']:'0')}">查看全部参数</a>
        {else /}
            暂未添加参数
        {/if}
    </div>
    {/empty}

    {notempty name="list"}
    <div class="mb10 ml10 mt10">
        <button class="btn btn-danger check-delete" type="button" data-url="{:url('@admin/site/param_delete')}">删除参数</button>
    </div>
    {/notempty}

</div>
{include file="site/param/create" /}
{/block}


<!-- JS -->
{block name="js"}
    {load href="/static/lib/jquery/jquery.form.js"}
    {load href="/static/lib/jquery/jquery.autofill.min.js"}
    {load href="/static/lib/validator/validator.min.js"}
{/block}
{block name="jscode"}{/block}